package cn.lijiajia3515.cairo.auth.modules.account;

import cn.lijiajia3515.cairo.auth.CairoAuthMeta;
import cn.lijiajia3515.cairo.auth.modules.department.PathDepartment;
import cn.lijiajia3515.cairo.auth.modules.role.Role;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 用户
 */
@Data
@NoArgsConstructor
@AllArgsConstructor

@SuperBuilder(toBuilder = true)
public class Account implements Serializable {

	/**
	 * uid
	 */
	@Field("id")
	private String id;

	/**
	 * 登录名
	 */
	private String login;

	/**
	 * 手机号
	 */
	private String phoneNumber;

	/**
	 * 邮箱
	 */
	private String email;


	/**
	 * 账号 启用
	 */
	private Boolean accountEnabled;

	/**
	 * 账号 锁定
	 */
	private Boolean accountLocked;

	/**
	 * 昵称
	 */
	private String nickname;

	/**
	 * 头像
	 */
	private String avatarUrl;

	/**
	 * 角色
	 */
	private List<Role> roles;

	/**
	 * 部门
	 */
	private List<PathDepartment> departments;

	/**
	 * 最后登录时间
	 */
	private LocalDateTime lastLoginAt;

	/**
	 * meta
	 */
	private CairoAuthMeta meta;

}
